﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security;
using webtracuudiem.Truyxuatdulieu;
using System.Web.Security;

namespace webtracuudiem
{
    public partial class Trangmonhoc : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ButThemMon_Click(object sender, EventArgs e)
        {
            string mamh, tenmh;
            mamh = TextBox1.Text;
            tenmh = TextBox2.Text;
            string sql = "INSERT INTO MonHoc VALUES('" + mamh + "',N'" + tenmh +"')";
            TienIchSql.ChayLenhCapNhatDuLieu(sql);
            Response.Redirect(Request.RawUrl);
        }

        protected void ButCapnhat_Click(object sender, EventArgs e)
        {
            string mamh, tenmh;
            mamh = TextBox1.Text;
            tenmh = TextBox2.Text;
            string sql = "UPDATE MonHoc SET tenmh=N'" + tenmh + "' where mamh='" + mamh + "'";
            TienIchSql.ChayLenhCapNhatDuLieu(sql);
            Response.Redirect(Request.RawUrl);
        }

        protected void ButThoat_Click(object sender, EventArgs e)
        {
            FormsAuthentication.SignOut();
            Response.Redirect("/Default.aspx");
        }

    }
}